package com.tedu.day04mybatis.mapper;

import com.tedu.day04mybatis.pojo.Weibo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface WeiboMapper {
    @Insert("INSERT INTO weibo(content,created,user_id) VALUES(#{content},#{created},#{userId})")
    int insert(Weibo weibo);

    @Delete("DELETE FROM weibo WHERE id=#{id}")
    int deleteById(Integer id);

    @Update("UPDATE weibo SET content=#{content},created=#{created},user_id=#{userId}")
    int updateById(Weibo weibo);
}
